/* Administrator.java
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 * 
 */

package domain;

import java.util.Collection;
import java.util.HashSet;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;



@Entity
@Access(AccessType.PROPERTY)
public class Administrator extends Actor {

	// Constructors -----------------------------------------------------------

	public Administrator() {
		super();
		challenges = new HashSet<Challenge>();
		events = new HashSet<Event>();
	}

	// Attributes -------------------------------------------------------------

	// Relationships ----------------------------------------------------------

	private Collection<Challenge> challenges;
	private Collection<Event> events;
	
	@Valid
	@NotNull
	@OneToMany(mappedBy="administrator")
	public Collection<Challenge> getChallenges() {
		return challenges;
	}
	public void setChallenges(Collection<Challenge> challenges) {
		this.challenges = challenges;
	}
	
	@Valid
	@NotNull
	@OneToMany(mappedBy="administrator")
	public Collection<Event> getEvents() {
		return events;
	}
	public void setEvents(Collection<Event> events) {
		this.events = events;
	}
	

}
